#ifndef __CHARGEFUNCTION_H__
#define __CHARGEFUNCTION_H__

#include <time.h>
#include <stdlib.h>
#include <stdio.h>

#include "../头文件/AllStruct.h"
#include "../头文件/AllFunction.h"

#define FUNCTIONS_IMAGE "../Image/functions.jpg"
#define EXIT_IMAGE "../Image/exit.jpg"
#define EXIT_SUCCESS_IMAGE "../Image/exitsuccess.jpg"
#define CHARGE_CARD "../Image/Charge_Card.jpg"
#define DEVICE_INFO "../Image/Device_Info.jpg"
#define CHARGING_PRICE "../Image/Charging_Price.jpg"
#define CHARGING_CARD_UNLOCK "../Image/Charging_Card_Unlock.jpg"
#define UNLOCK_SUCCESS "../Image/Unlock_Success.jpg"
#define CHARGING_ACCOUNT "../Image/Charging_Account.jpg"
#define CHANGE_PASSWORD "../Image/Change_Password.jpg"
#define OLD_PASSWORD_WRONG "../Image/OldPasswordWrong.jpg"
#define NEW_PASSWORD_WRONG "../Image/NewPasswordWrong.jpg"
#define NEW_PASSWORD_SUCCESS "../Image/NewPasswordSuccess.jpg"
#define RECHARGE_INTERFACE "../Image/Recharge_Interface.jpg"
#define PAYWAY "../Image/PayWay.jpg"
#define PAYWAY_RECHARGE "../Image/Payment_Recharge.jpg"
#define PAYWINDOW "../Image/Pay.jpg"
#define CHARGING_FIND "../Image/Charging_Find.jpg"
#define CHARGE_MODE "../Image/Charge_Mode.jpg"
#define CHARGE_END "../Image/Charge_End.jpg"
#define CHARGE_START "../Image/Charge_Start.jpg"
#define CHARGE_ING "../Image/Charging_.jpg"
#define CHARGING_AFTER "../Image/Charging_After.jpg"


// 定义一个当前登录账号的结构体
extern UserData CurrentUser;

// 定义一个当前接入设备的结构体
extern Device CurrentDevice;

// 当前输入的旧密码
char InputOldPassword[30];

// 当前输入的新密码
char InputNewPassword[30];

// 当前输入的充值价钱
char InputRechargeNum[30];

// 当前充电的价钱
char ChargingPrice[30];

TextType getDate();

void functions();

void show_current_account();

void showdate(TextType curdate);

void updateDateFromSystem(TextType time_string, size_t size);

void exit_account(Function Function_Flag);

Function functions_click_event(bool BlockState, TextType curdate);

void show_charge_card();

void close_functions_window();

void show_device_info();

Device Get_Device_By_Position(TextType position);

void show_charging_price();

void show_charging_card_unlock();

void unlock_card();

void show_charging_account();

void change_password();

void show_charging_info();

void show_charge_mode();

void recharge();

void InputPrice();

void balance_payment(char money[]);

void WeChat_Alipay_payment(char money[]);

Flag Recharge_click(bool BlockState);

void Pay(Function flag);

PaymentWay Pay_click(Function flag, bool BlockState);

PaymentWay forfeiture_of_payment(bool BlockState);

ChargeState Charge_click(ChargeState flag, bool BlockState);

void show_Charge_Start();

void get_elapsed_time(int seconds, char *time_str);

bool is_between_time_range(const char *time_str, const char *start_time, const char *end_time);

int compare_times(const char *time1, const char *time2);

bool check_time_period(const char *time_str);
#endif